import * as types from './actionTypes';
import Request from '../../utils/request.js';
import API from '../../../../config/api';
import reqwest from 'reqwest';

export function meInfo(){
    return (dispatch,getState) => {
        reqwest(Request.getOptions(
            "get",
            API.me,
            null,
            true
        )).then( response => {
            dispatch({
                type:types.SET_ME_INFO,
                info:response
            })
        }).fail(function (err) {
            Request.handleError(err);
        }).always((resp) =>{})
    }
}
